<?php

namespace App\Http\Controllers;

use App\Models\Publicity;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Support\Facades\Request;


class IndexController extends BaseController
{
    public function index(){
        $data = Publicity::orderBy('sort','desc')->get();
        return view('index',compact('data',$data));
    }

    public function about(){
        return view('about');
    }
    public function notice(){
        $data = Publicity::orderBy('sort','desc')->get();
        return view('notice',compact('data',$data));
    }

    public function article(){
        $id = Request::input('id');
        $data = Publicity::where('id',$id)->first();
        return view('article',compact('data',$data));
    }
}
